import Web3 from "web3";

let web3;

// 检查 MetaMask 是否可用
if (window.ethereum) {
    web3 = new Web3(window.ethereum);
    window.ethereum.request({ method: "eth_requestAccounts" });
} else {
    console.error("MetaMask 未检测到，请安装后重试。");
}

export default web3;

